package com.dream.technology.utils.baiqishi;//package com.dream.technology.utils.baiqishi;
//
//
//import com.alibaba.fastjson.JSON;
//import com.dream.technology.config.HttpClient;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//import java.util.Map;
//
///**
// * Utils - 白骑士工具类 Created by pan on 2018/01/13.
// *
// * @author pan
// */
//@Component("baiqishiUtils")
//public class BaiqishiUtils {
//
//
//    @Resource(name = "HttpClientUtils")
//    private HttpClient httpClient;
//
//    // 需要传入产品id 白骑士标从运营平台获取配置
//
//
//    /**
//     * 绑卡事件
//     */
//    public  Map<String, String> binding(BindingField field) {
//        BaiqishiSetting baiqishiSetting = SettingUtils.get().getBaiqishiSetting();
//        field.setAppId(baiqishiSetting.getNormalAppId());
//        field.setPartnerId(baiqishiSetting.getPartnerId());
//        field.setVerifyKey(baiqishiSetting.getVerifyKey());
//        field.setEventType(EventType.binding.name());
//        return httpClient.getPostResp(baiqishiSetting.getBaiqishiUrl(),JSON.toJSONString(field ) );
//    }
//
//    /**
//     * 续贷事件
//     */
//    public  Map<String, String> loanAgain(LoanField field) {
//        BaiqishiSetting baiqishiSetting = SettingUtils.get().getBaiqishiSetting();
//        field.setAppId(baiqishiSetting.getReBorrowing());
//        field.setPartnerId(baiqishiSetting.getPartnerId());
//        field.setVerifyKey(baiqishiSetting.getVerifyKey());
//        field.setEventType(EventType.cust00001.name());
//        return httpClient.getPostResp(baiqishiSetting.getBaiqishiUrl(), JSON.toJSONString(field ));
//    }
//
//
//    /**
//     * 贷款事件
//     */
//    public  Map<String, String> loan(LoanField field) {
//        BaiqishiSetting baiqishiSetting = SettingUtils.get().getBaiqishiSetting();
//        if (level == 1) {
//            field.setAppId(baiqishiSetting.getEasyAppId());
//            field.setEventType(EventType.loan.name());
//        } else if (level == 2) {
//            field.setAppId(baiqishiSetting.getCommonAppId());
//            field.setEventType(EventType.loan.name());
//        } else if (level == 5) {
//            field.setAppId(baiqishiSetting.getWhiteListAppId());
//            field.setEventType(EventType.other.name());
//        } else if (level == 6) {
//            field.setAppId(baiqishiSetting.getSevenDayCustomer());
//            field.setEventType(EventType.loan.name());
//        } else {
//            field.setAppId(baiqishiSetting.getStrictAppId());
//            field.setEventType(EventType.loan.name());
//        }
//        field.setPartnerId(baiqishiSetting.getPartnerId());
//        field.setVerifyKey(baiqishiSetting.getVerifyKey());
//        return httpClient.getPostResp(baiqishiSetting.getBaiqishiUrl(), JSON.toJSONString(field ));
//    }
//
//    /**
//     * 登录事件
//     */
//    public  Map<String, String> login(LoginField field) {
//        BaiqishiSetting baiqishiSetting = SettingUtils.get().getBaiqishiSetting();
//        field.setAppId(baiqishiSetting.getNormalAppId());
//        field.setPartnerId(baiqishiSetting.getPartnerId());
//        field.setVerifyKey(baiqishiSetting.getVerifyKey());
//        field.setEventType(EventType.login.name());
//        return httpClient.getPostResp(baiqishiSetting.getBaiqishiUrl(), JSON.toJSONString(field ));
//    }
//
//    /**
//     * 登录事件-复贷
//     */
//    public  Map<String, String> reBorrowLogin(LoginField field) {
//        BaiqishiSetting baiqishiSetting = SettingUtils.get().getBaiqishiSetting();
//        field.setAppId(baiqishiSetting.getReBorrowing());
//        field.setPartnerId(baiqishiSetting.getPartnerId());
//        field.setVerifyKey(baiqishiSetting.getVerifyKey());
//        field.setEventType(EventType.login.name());
//        return httpClient.getPostResp(baiqishiSetting.getBaiqishiUrl(),JSON.toJSONString(field ));
//    }
//
//
//    /**
//     * 修改事件
//     */
//    public  Map<String, String> modify(ModifyField field) {
//        BaiqishiSetting baiqishiSetting = SettingUtils.get().getBaiqishiSetting();
//        field.setAppId(baiqishiSetting.getNormalAppId());
//        field.setPartnerId(baiqishiSetting.getPartnerId());
//        field.setVerifyKey(baiqishiSetting.getVerifyKey());
//        field.setEventType(EventType.modify.name());
//        return httpClient.getPostResp(baiqishiSetting.getBaiqishiUrl(), JSON.toJSONString(field ));
//    }
//
//    /**
//     * 注册事件
//     */
//    public  Map<String, String> register(RegisterField field) {
//        BaiqishiSetting baiqishiSetting = SettingUtils.get().getBaiqishiSetting();
//
//        field.setAppId(baiqishiSetting.getNormalAppId());
//        field.setPartnerId(baiqishiSetting.getPartnerId());
//        field.setVerifyKey(baiqishiSetting.getVerifyKey());
//        field.setEventType(EventType.register.name());
//        return httpClient.getPostResp(baiqishiSetting.getBaiqishiUrl(), JSON.toJSONString(field ));
//    }
//
//
//    /**
//     * 认证事件
//     */
//    public  Map<String, String> auth(AuthField field) {
//        BaiqishiSetting baiqishiSetting = SettingUtils.get().getBaiqishiSetting();
//        field.setAppId(baiqishiSetting.getNormalAppId());
//        field.setPartnerId(baiqishiSetting.getPartnerId());
//        field.setVerifyKey(baiqishiSetting.getVerifyKey());
//        field.setEventType(EventType.verify.name());
//        return httpClient.getPostResp(baiqishiSetting.getBaiqishiUrl(), JSON.toJSONString(field ));
//    }
//
//
//}
